<!--

    Copyright (c) 2012, Mayocat <hello@mayocat.org>

    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.

-->
<!-- list -->
<div id="list" ng-controller="PagesController">

    <div class="header">
        <h2>{{'content.title.allPages' | translate}}</h2>
    </div>

    <!-- list pages -->
    <scroll>
        <ul class="list">
            <li ng-repeat="page in pages" data-handle="{{page.slug}}" class="hasChildren" ng-class="{active: entity.slug == page.slug && entity.type == 'page'}">
                <div>
                    <div class="droptarget">
                        <div><a ng-click="setRoute('/pages/' + page.slug)">{{page.title}}</a></div>
                        <div><span class="drag-me move-handle"></span></div>
                    </div>
                </div>
            </li>
        </ul>
    </scroll>

</div>

<!-- Deletion modal for pages -->
<script type="text/ng-template" id="confirmDeletionPage.html">
    <div class="modal-header">
        <button type="button" class="close" ng-click="$dismiss()">&times;</button>
        <h3>{{'entity.title.confirmDeletion' | translate}}</h3>
    </div>
    <div class="modal-body">
        {{'content.alert.confirmPageDeletion' | translate}}
    </div>
    <div class="modal-footer">
        <button class="btn" ng-click="$dismiss()">
            {{'entity.action.cancel' | translate}}
        </button>
        <button class="btn btn-danger" ng-click="$close()">
            {{'content.action.deletePage' | translate}}
        </button>
    </div>
</script>
